/**
 * 
 */
package view;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JPanel;

import common.DataManager;

import controller.Controller;

/**
 * @author Bill
 * 
 * This is the panel which is displayed during the mainMenu state
 *
 */
public class MainMenuPanel extends JPanel implements MouseListener{
	
	/**
	 * Constructs the panel
	 */
	public MainMenuPanel(){
		
		this.setBackground(Color.BLACK);
		this.setLayout(new BorderLayout());
		
		ImagePanel backgroundImage = new ImagePanel(DataManager.TITLE_SCREEN);
		backgroundImage.setOpaque(false);
		backgroundImage.setSize(backgroundImage.getPreferredSize());
		
		this.setPreferredSize(backgroundImage.getPreferredSize());
		this.add(backgroundImage, BorderLayout.CENTER);		
		addMouseListener(this);
	}

	/**
	 * Mouse click is handled in the controller class
	 */
	@Override
	public void mouseClicked(MouseEvent arg0) {
		Controller.advanceState();
	}

	@Override
	public void mouseEntered(MouseEvent arg0) {}

	@Override
	public void mouseExited(MouseEvent arg0) {}

	@Override
	public void mousePressed(MouseEvent arg0) {}

	@Override
	public void mouseReleased(MouseEvent arg0) {}

}
